package com.tms.quartz.mail.thread;

import com.tms.quartz.mail.ApplicationContextProvider;
import com.tms.quartz.mail.MailService;

/**
 * 带附件的邮件发送线程
 *
 * @author ozj jackie
 * @date 2020年6月30日
 */
public class FileMailThread implements Runnable {

    /**
     * 获取bean
     */
    private MailService mailService = (MailService) ApplicationContextProvider.getBean(MailService.class);

    String to;
    String subject;
    String content;
    String filePath;

    public FileMailThread(String to, String subject, String content, String filePath) {
        this.to = to;
        this.subject = subject;
        this.content = content;
        this.filePath = filePath;
    }

    @Override
    public void run() {
        mailService.sendMailWithFile(to, subject, content, filePath);
    }
}
